﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptHoaDonChuaThanhToan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("CboHienThi")]
        private ComboBox _CboHienThi;
        [AccessedThroughProperty("CKTuNgay")]
        private System.Windows.Forms.CheckBox _CKTuNgay;
        [AccessedThroughProperty("CmdExel")]
        private System.Windows.Forms.Button _CmdExel;
        [AccessedThroughProperty("CmdLoad")]
        private System.Windows.Forms.Button _CmdLoad;
        [AccessedThroughProperty("CmdPrint")]
        private System.Windows.Forms.Button _CmdPrint;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Label16")]
        private System.Windows.Forms.Label _Label16;
        [AccessedThroughProperty("Label2")]
        private System.Windows.Forms.Label _Label2;
        [AccessedThroughProperty("Label3")]
        private System.Windows.Forms.Label _Label3;
        [AccessedThroughProperty("Label4")]
        private System.Windows.Forms.Label _Label4;
        [AccessedThroughProperty("Label5")]
        private System.Windows.Forms.Label _Label5;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtTongConLai")]
        private C1NumericEdit _TxtTongConLai;
        [AccessedThroughProperty("TxtTongThanhTien")]
        private C1NumericEdit _TxtTongThanhTien;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;

        [DebuggerNonUserCode]
        public Frm_RptHoaDonChuaThanhToan()
        {
            base.Load += new EventHandler(this.Frm_RptHoaDonChuaThanhToan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CboHienThi_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.CboHienThi.SelectedIndex == 0)
            {
                this.CKTuNgay.Checked = true;
                this.CKTuNgay.Enabled = false;
            }
            else
            {
                this.CKTuNgay.Enabled = true;
            }
        }

        private void CKTuNgay_CheckedChanged(object sender, EventArgs e)
        {
            this.TxtTuNgay.Enabled = this.CKTuNgay.Checked;
        }

        private void CmdExel_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog dialog = new SaveFileDialog {
                    Filter = "Excel Files|*.xls",
                    Title = "Save an Excel file"
                };
                dialog.ShowDialog();
                if (dialog.FileName != "")
                {
                    this.VSlist.SaveExcel(dialog.FileName, "DoanhThu", FileFlags.IncludeFixedCells);
                    Excel.Application application = new ApplicationClass();
                    Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                    application.Visible = true;
                }
            }
            catch (COMException exception1)
            {
                ProjectData.SetProjectError(exception1);
                COMException exception = exception1;
                MessageBox.Show(exception.Message);
                ProjectData.ClearProjectError();
            }
            catch (Exception exception3)
            {
                ProjectData.SetProjectError(exception3);
                Exception exception2 = exception3;
                MessageBox.Show(exception2.Message);
                ProjectData.ClearProjectError();
            }
        }

        private void CmdLoad_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_RptHoaDonChuaThanhToan_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                LVYModule.advFormatNumber(this.TxtTongThanhTien, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtTongThanhToan, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtTongConLai, modGeneral.H_FORMATNUMBER);
                this.CboHienThi.Items.Clear();
                this.CboHienThi.Items.Add(modGeneral.Tranlated("Tất cả", ""));
                this.CboHienThi.Items.Add(modGeneral.Tranlated("Nợ thanh to\x00e1n", ""));
                this.CboHienThi.SelectedIndex = 1;
                this.LoadData();
            }
        }

        public object GetData()
        {
            object obj2;
            int num;
            string str;
            IDataParameter[] commandParameters = new IDataParameter[6];
            if (this.CKTuNgay.Checked)
            {
                str = LVYModule.Date2Char(this.TxtTuNgay.Text);
            }
            else
            {
                str = "00000000";
            }
            if (this.CboHienThi.SelectedIndex == 1)
            {
                num = 0;
            }
            else
            {
                num = 1;
            }
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, str);
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Double, ParameterDirection.Input, LVYModule.Date2Char(this.TxtDenNgay.Text));
                commandParameters[2] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, modGeneral.H_CLIENT);
                commandParameters[3] = DBHelper.createParameter("@KhoaKhachHang", DbType.Int64, ParameterDirection.Input, this.AdvKhachHang.Value);
                commandParameters[4] = DBHelper.createParameter("@HienThi", DbType.Double, ParameterDirection.Input, num);
                commandParameters[5] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                obj2 = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BH_BC_HoaDonChuaThanhToan", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                obj2 = null;
                ProjectData.ClearProjectError();
                return obj2;
                ProjectData.ClearProjectError();
            }
            return obj2;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptHoaDonChuaThanhToan));
            this.Panel1 = new Panel();
            this.Panel2 = new Panel();
            this.CmdLoad = new System.Windows.Forms.Button();
            this.CmdExel = new System.Windows.Forms.Button();
            this.Label2 = new System.Windows.Forms.Label();
            this.CboHienThi = new ComboBox();
            this.CKTuNgay = new System.Windows.Forms.CheckBox();
            this.CmdPrint = new System.Windows.Forms.Button();
            this.Label16 = new System.Windows.Forms.Label();
            this.AdvKhachHang = new ADVObjects();
            this.Label1 = new System.Windows.Forms.Label();
            this.TxtDenNgay = new DateTimePicker();
            this.TxtTuNgay = new DateTimePicker();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel3 = new Panel();
            this.Panel4 = new Panel();
            this.Label5 = new System.Windows.Forms.Label();
            this.Label4 = new System.Windows.Forms.Label();
            this.Label3 = new System.Windows.Forms.Label();
            this.TxtTongConLai = new C1NumericEdit();
            this.TxtTongThanhToan = new C1NumericEdit();
            this.TxtTongThanhTien = new C1NumericEdit();
            this.Panel1.SuspendLayout();
            this.Panel2.SuspendLayout();
            this.VSlist.BeginInit();
            this.Panel3.SuspendLayout();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtTongConLai).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhTien).BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.Panel2);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.CboHienThi);
            this.Panel1.Controls.Add(this.CKTuNgay);
            this.Panel1.Controls.Add(this.CmdPrint);
            this.Panel1.Controls.Add(this.Label16);
            this.Panel1.Controls.Add(this.AdvKhachHang);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x3e2, 0x2f);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x7b;
            this.Panel2.BackColor = Color.Transparent;
            this.Panel2.Controls.Add(this.CmdLoad);
            this.Panel2.Controls.Add(this.CmdExel);
            this.Panel2.Dock = DockStyle.Right;
            point = new System.Drawing.Point(0x326, 0);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0xbc, 0x2f);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x7a;
            this.CmdLoad.Image = (Image) manager.GetObject("CmdLoad.Image");
            this.CmdLoad.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x10, 0x11);
            this.CmdLoad.Location = point;
            this.CmdLoad.Name = "CmdLoad";
            size = new Size(0x53, 0x19);
            this.CmdLoad.Size = size;
            this.CmdLoad.TabIndex = 0x73;
            this.CmdLoad.Text = "Load";
            this.CmdLoad.UseVisualStyleBackColor = true;
            this.CmdExel.Image = (Image) manager.GetObject("CmdExel.Image");
            this.CmdExel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(100, 0x11);
            this.CmdExel.Location = point;
            this.CmdExel.Name = "CmdExel";
            size = new Size(0x53, 0x19);
            this.CmdExel.Size = size;
            this.CmdExel.TabIndex = 0x75;
            this.CmdExel.Text = "&Excel";
            this.CmdExel.UseVisualStyleBackColor = true;
            this.Label2.AutoEllipsis = true;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x1ed, 4);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            this.Label2.RightToLeft = RightToLeft.No;
            size = new Size(0x2b, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x79;
            this.Label2.Text = "Hiển thị";
            this.Label2.TextAlign = ContentAlignment.TopRight;
            this.CboHienThi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboHienThi.FormattingEnabled = true;
            point = new System.Drawing.Point(0x1f0, 20);
            this.CboHienThi.Location = point;
            this.CboHienThi.Name = "CboHienThi";
            size = new Size(0x83, 0x15);
            this.CboHienThi.Size = size;
            this.CboHienThi.TabIndex = 120;
            this.CKTuNgay.AutoSize = true;
            this.CKTuNgay.BackColor = Color.Transparent;
            point = new System.Drawing.Point(7, 3);
            this.CKTuNgay.Location = point;
            this.CKTuNgay.Name = "CKTuNgay";
            size = new Size(0x41, 0x11);
            this.CKTuNgay.Size = size;
            this.CKTuNgay.TabIndex = 0x77;
            this.CKTuNgay.Text = "Từ ng\x00e0y";
            this.CKTuNgay.UseVisualStyleBackColor = false;
            this.CmdPrint.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdPrint.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x33a, 0x2e);
            this.CmdPrint.Location = point;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x53, 0x19);
            this.CmdPrint.Size = size;
            this.CmdPrint.TabIndex = 0x74;
            this.CmdPrint.Text = "Trang in";
            this.CmdPrint.UseVisualStyleBackColor = true;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0xb8, 4);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x72;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.AdvKhachHang.Conditions = "";
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new System.Drawing.Point(0xbb, 20);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(0x12e, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 0x71;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x5d, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x35, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3f;
            this.Label1.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(0x60, 20);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x55, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x3e;
            this.TxtTuNgay.Enabled = false;
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(6, 20);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x53, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 60;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new System.Drawing.Point(0, 0x2f);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.MaxSize = 0x12;
            this.VSlist.Rows.MinSize = 0x12;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x3e2, 0x216);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x7c;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.Panel3.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel3.Controls.Add(this.Panel4);
            this.Panel3.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 0x245);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x3e2, 0x2c);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 0x7d;
            this.Panel4.BackColor = Color.Transparent;
            this.Panel4.Controls.Add(this.Label5);
            this.Panel4.Controls.Add(this.Label4);
            this.Panel4.Controls.Add(this.Label3);
            this.Panel4.Controls.Add(this.TxtTongConLai);
            this.Panel4.Controls.Add(this.TxtTongThanhToan);
            this.Panel4.Controls.Add(this.TxtTongThanhTien);
            this.Panel4.Dock = DockStyle.Right;
            point = new System.Drawing.Point(680, 0);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x13a, 0x2c);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 0x12;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0xd0, 0x1b);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x2f, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x8b;
            this.Label5.Text = "Tổng nợ";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            this.Label4.AutoEllipsis = true;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new System.Drawing.Point(110, 0x1b);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            this.Label4.RightToLeft = RightToLeft.No;
            size = new Size(0x56, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x8a;
            this.Label4.Text = "Tổng thanh to\x00e1n";
            this.Label4.TextAlign = ContentAlignment.TopRight;
            this.Label3.AutoEllipsis = true;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new System.Drawing.Point(3, 0x1b);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = RightToLeft.No;
            size = new Size(0x4e, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x89;
            this.Label3.Text = "Tổng ph\x00e1t sinh";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.TxtTongConLai.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongConLai.DataType = typeof(double);
            this.TxtTongConLai.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0xd3, 4);
            this.TxtTongConLai.Location = point;
            this.TxtTongConLai.Name = "TxtTongConLai";
            Padding padding = new Padding(1);
            this.TxtTongConLai.Padding = padding;
            this.TxtTongConLai.ReadOnly = true;
            size = new Size(0x62, 20);
            this.TxtTongConLai.Size = size;
            this.TxtTongConLai.TabIndex = 0x88;
            this.TxtTongConLai.Tag = null;
            this.TxtTongConLai.TextAlign = HorizontalAlignment.Right;
            this.TxtTongConLai.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongConLai.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongConLai.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToan.DataType = typeof(double);
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x71, 4);
            this.TxtTongThanhToan.Location = point;
            this.TxtTongThanhToan.Name = "TxtTongThanhToan";
            padding = new Padding(1);
            this.TxtTongThanhToan.Padding = padding;
            this.TxtTongThanhToan.ReadOnly = true;
            size = new Size(0x60, 20);
            this.TxtTongThanhToan.Size = size;
            this.TxtTongThanhToan.TabIndex = 0x87;
            this.TxtTongThanhToan.Tag = null;
            this.TxtTongThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhTien.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhTien.DataType = typeof(double);
            this.TxtTongThanhTien.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(5, 4);
            this.TxtTongThanhTien.Location = point;
            this.TxtTongThanhTien.Name = "TxtTongThanhTien";
            padding = new Padding(1);
            this.TxtTongThanhTien.Padding = padding;
            this.TxtTongThanhTien.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTongThanhTien.Size = size;
            this.TxtTongThanhTien.TabIndex = 0x86;
            this.TxtTongThanhTien.Tag = null;
            this.TxtTongThanhTien.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhTien.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhTien.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhTien.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x3e2, 0x271);
            this.ClientSize = size;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.Panel3);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptHoaDonChuaThanhToan";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-BH02";
            this.Text = "HOA DON NO THANH TOAN";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.Panel2.ResumeLayout(false);
            this.VSlist.EndInit();
            this.Panel3.ResumeLayout(false);
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            ((ISupportInitialize) this.TxtTongConLai).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToan).EndInit();
            ((ISupportInitialize) this.TxtTongThanhTien).EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            System.Data.DataTable data = (System.Data.DataTable) this.GetData();
            string str = "";
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows.Count = 1;
            int num3 = data.Rows.Count - 1;
            for (int i = 0; i <= num3; i++)
            {
                vSlist.AddItem("");
                if (str.Trim() != data.Rows[i]["Khoa"].ToString().Trim())
                {
                    str = data.Rows[i]["Khoa"].ToString().Trim();
                    num2 = Conversions.ToDouble(data.Rows[i]["DaThanhToan"]);
                }
                vSlist[i + 1, 0] = RuntimeHelpers.GetObjectValue(data.Rows[i]["KhachHang"]);
                vSlist[i + 1, 1] = RuntimeHelpers.GetObjectValue(data.Rows[i]["Khoa"]);
                vSlist[i + 1, 2] = RuntimeHelpers.GetObjectValue(data.Rows[i]["Ngay"]);
                vSlist[i + 1, 3] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoChungTu"]);
                vSlist[i + 1, 4] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoHoaDon"]);
                vSlist[i + 1, 5] = RuntimeHelpers.GetObjectValue(data.Rows[i]["MaHang"]);
                vSlist[i + 1, 6] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TenHang"]);
                vSlist[i + 1, 7] = RuntimeHelpers.GetObjectValue(data.Rows[i]["DonViTinh"]);
                vSlist[i + 1, 8] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoLuong"]);
                vSlist[i + 1, 9] = RuntimeHelpers.GetObjectValue(data.Rows[i]["DonGia"]);
                vSlist[i + 1, 10] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TienChietKhau"]);
                vSlist[i + 1, 11] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TienThue"]);
                vSlist[i + 1, 12] = RuntimeHelpers.GetObjectValue(data.Rows[i]["ThanhTien"]);
                vSlist[i + 1, 13] = RuntimeHelpers.GetObjectValue(data.Rows[i]["HanThanhToan"]);
                if (num2 != 0.0)
                {
                    if (num2 > Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[i]["ThanhTien"])))
                    {
                        num2 -= Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[i]["ThanhTien"]));
                        vSlist[i + 1, 14] = RuntimeHelpers.GetObjectValue(data.Rows[i]["ThanhTien"]);
                    }
                    else
                    {
                        vSlist[i + 1, 14] = num2;
                        num2 = 0.0;
                    }
                    vSlist[i + 1, 15] = RuntimeHelpers.GetObjectValue(data.Rows[i]["NgayThuTien"]);
                }
                else
                {
                    vSlist[i + 1, 14] = 0;
                    vSlist[i + 1, 15] = "";
                }
                vSlist[i + 1, 0x10] = Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[i + 1, 12])) - Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[i + 1, 14]));
                vSlist[i + 1, 0x11] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoNgayTreHan"]);
            }
            this.TxtTongThanhTien.Value = LVYModule.SumColGrid(this.VSlist, 12);
            this.TxtTongThanhToan.Value = LVYModule.SumColGrid(this.VSlist, 14);
            this.TxtTongConLai.Value = LVYModule.SumColGrid(this.VSlist, 0x10);
            vSlist.Tree.Column = 6;
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 12, "{0}");
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 14, "{0}");
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0x10, "{0}");
            vSlist = null;
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvKhachHang = value;
            }
        }

        internal virtual ComboBox CboHienThi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboHienThi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboHienThi_SelectedIndexChanged);
                if (this._CboHienThi != null)
                {
                    this._CboHienThi.SelectedIndexChanged -= handler;
                }
                this._CboHienThi = value;
                if (this._CboHienThi != null)
                {
                    this._CboHienThi.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.CheckBox CKTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKTuNgay_CheckedChanged);
                if (this._CKTuNgay != null)
                {
                    this._CKTuNgay.CheckedChanged -= handler;
                }
                this._CKTuNgay = value;
                if (this._CKTuNgay != null)
                {
                    this._CKTuNgay.CheckedChanged += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExel_Click);
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click -= handler;
                }
                this._CmdExel = value;
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdLoad
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLoad;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLoad_Click);
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click -= handler;
                }
                this._CmdLoad = value;
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPrint = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual C1NumericEdit TxtTongConLai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongConLai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongConLai = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhTien = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

